package com.seafwg.mybatisplus.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.seafwg.mybatisplus.enums.StatusEnum;
import lombok.Data;

import java.util.Date;

@Data
@TableName("user")
public class User {
    @TableId(value="id", type = IdType.ASSIGN_ID)
    private Long id;
    private String username;
    private Integer age;
    @TableField(value = "create_time", fill = FieldFill.INSERT) // fill的填充需要添加自动填充处理器MetaObjectHandle
    private Date createTime;
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
//    @Version
    private Integer version;
    // 枚举类型解决数据库字段映射成实体类字段
    private StatusEnum status;
    @TableLogic
    private Integer deleted;
}
